go/types.operand.typ (field)

298 uses

	go/types (current package)
		api.go#L440: 	x := operand{mode: value, typ: V}
		api.go#L451: 	x := operand{mode: value, typ: V}
		assignments.go#L34: 	if isUntyped(x.typ) {
		assignments.go#L42: 			if T == nil && x.typ == Typ[UntypedNil] {
		assignments.go#L47: 			target = Default(x.typ)
		assignments.go#L68: 		if newType != x.typ {
		assignments.go#L69: 			x.typ = newType
		assignments.go#L75: 	if sig, _ := under(x.typ).(*Signature); sig != nil && sig.TypeParams().Len() > 0 {
		assignments.go#L106: 	if x.mode == invalid || x.typ == Typ[Invalid] || lhs.typ == Typ[Invalid] {
		assignments.go#L121: 	assert(isConstType(x.typ))
		assignments.go#L125: 		lhs.typ = x.typ
		assignments.go#L137: 	if x.mode == invalid || x.typ == Typ[Invalid] || lhs.typ == Typ[Invalid] {
		assignments.go#L146: 		typ := x.typ
		assignments.go#L164: 	return x.typ
		assignments.go#L168: 	if x.mode == invalid || x.typ == Typ[Invalid] {
		assignments.go#L183: 		return x.typ
		assignments.go#L209: 	if z.mode == invalid || z.typ == Typ[Invalid] {
		assignments.go#L233: 	check.assignment(x, z.typ, "assignment")
		assignments.go#L238: 	return x.typ
		assignments.go#L244: 		res = append(res, x.typ)
		builtins.go#L84: 		S := x.typ
		builtins.go#L119: 				if t := coreString(x.typ); t != nil && isString(t) {
		builtins.go#L121: 						sig := makeSig(S, S, x.typ)
		builtins.go#L126: 					x.typ = S
		builtins.go#L151: 		x.typ = S
		builtins.go#L161: 		switch t := arrayPtrDeref(under(x.typ)).(type) {
		builtins.go#L196: 			if !isTypeParam(x.typ) {
		builtins.go#L218: 		if mode == invalid && under(x.typ) != Typ[Invalid] {
		builtins.go#L229: 			check.recordBuiltinType(call.Fun, makeSig(Typ[Int], x.typ))
		builtins.go#L233: 		x.typ = Typ[Int]
		builtins.go#L238: 		if !underIs(x.typ, func(u Type) bool {
		builtins.go#L254: 			check.recordBuiltinType(call.Fun, makeSig(nil, x.typ))
		builtins.go#L267: 		if isUntyped(x.typ) {
		builtins.go#L270: 		if isUntyped(y.typ) {
		builtins.go#L278: 			check.convertUntyped(x, y.typ)
		builtins.go#L281: 			check.convertUntyped(&y, x.typ)
		builtins.go#L293: 					if isNumeric(x.typ) && constant.Sign(constant.Imag(x.val)) == 0 {
		builtins.go#L294: 						x.typ = Typ[UntypedFloat]
		builtins.go#L311: 		if !Identical(x.typ, y.typ) {
		builtins.go#L312: 			check.invalidArg(x, _InvalidComplex, "mismatched types %s and %s", x.typ, y.typ)
		builtins.go#L334: 			check.invalidArg(x, _InvalidComplex, "arguments have type %s, expected floating-point", x.typ)
		builtins.go#L346: 			check.recordBuiltinType(call.Fun, makeSig(resTyp, x.typ, x.typ))
		builtins.go#L349: 		x.typ = resTyp
		builtins.go#L353: 		dst, _ := coreType(x.typ).(*Slice)
		builtins.go#L360: 		src0 := coreString(y.typ)
		builtins.go#L377: 			check.recordBuiltinType(call.Fun, makeSig(Typ[Int], x.typ, y.typ))
		builtins.go#L380: 		x.typ = Typ[Int]
		builtins.go#L386: 		map_ := x.typ
		builtins.go#L424: 		if isUntyped(x.typ) {
		builtins.go#L428: 				if isNumeric(x.typ) {
		builtins.go#L429: 					x.typ = Typ[UntypedComplex]
		builtins.go#L466: 			check.invalidArg(x, code, "argument has type %s, expected complex type", x.typ)
		builtins.go#L482: 			check.recordBuiltinType(call.Fun, makeSig(resTyp, x.typ))
		builtins.go#L485: 		x.typ = resTyp
		builtins.go#L529: 		x.typ = T
		builtins.go#L531: 			check.recordBuiltinType(call.Fun, makeSig(x.typ, types...))
		builtins.go#L543: 		x.typ = &Pointer{base: T}
		builtins.go#L545: 			check.recordBuiltinType(call.Fun, makeSig(x.typ, T))
		builtins.go#L588: 				params[i] = x.typ
		builtins.go#L600: 		x.typ = &emptyInterface
		builtins.go#L602: 			check.recordBuiltinType(call.Fun, makeSig(x.typ))
		builtins.go#L624: 		x.typ = Typ[UnsafePointer]
		builtins.go#L626: 			check.recordBuiltinType(call.Fun, makeSig(x.typ, x.typ, y.typ))
		builtins.go#L636: 		if hasVarSize(x.typ) {
		builtins.go#L639: 				check.recordBuiltinType(call.Fun, makeSig(Typ[Uintptr], x.typ))
		builtins.go#L643: 			x.val = constant.MakeInt64(check.conf.alignof(x.typ))
		builtins.go#L646: 		x.typ = Typ[Uintptr]
		builtins.go#L664: 		base := derefStructPtr(x.typ)
		builtins.go#L710: 		x.typ = Typ[Uintptr]
		builtins.go#L719: 		if hasVarSize(x.typ) {
		builtins.go#L722: 				check.recordBuiltinType(call.Fun, makeSig(Typ[Uintptr], x.typ))
		builtins.go#L726: 			x.val = constant.MakeInt64(check.conf.sizeof(x.typ))
		builtins.go#L729: 		x.typ = Typ[Uintptr]
		builtins.go#L738: 		typ, _ := under(x.typ).(*Pointer)
		builtins.go#L751: 		x.typ = NewSlice(typ.base)
		builtins.go#L753: 			check.recordBuiltinType(call.Fun, makeSig(x.typ, typ, y.typ))
		builtins.go#L760: 		if x.mode != constant_ || !isBoolean(x.typ) {
		builtins.go#L828: 	if tp, _ := x.typ.(*TypeParam); tp != nil {
		builtins.go#L872: 	return f(x.typ)
		call.go#L33: 	sig := x.typ.(*Signature)
		call.go#L58: 	x.typ = res
		call.go#L128: 		T := x.typ
		call.go#L174: 	sig, _ := coreType(x.typ).(*Signature)
		call.go#L227: 		x.typ = sig.results.vars[0].typ // unpack tuple
		call.go#L230: 		x.typ = sig.results
		call.go#L237: 	if x.mode == value && sig.TypeParams().Len() > 0 && isParameterized(sig.TypeParams().list(), x.typ) {
		call.go#L254: 		if t, ok := x.typ.(*Tuple); ok && x.mode != invalid {
		call.go#L258: 				xlist[i] = &operand{mode: value, expr: e, typ: v.typ}
		call.go#L266: 			x2 := &operand{mode: value, expr: e, typ: Typ[UntypedBool]}
		call.go#L268: 				x2.typ = universeError
		call.go#L498: 				x.typ = exp.typ
		call.go#L502: 				x.typ = exp.typ
		call.go#L505: 				x.typ = exp.typ
		call.go#L507: 					x.typ = x.typ.(*Pointer).base
		call.go#L511: 				x.typ = exp.typ
		call.go#L514: 					x.typ = x.typ.(*Signature).results.vars[0].typ
		call.go#L518: 				x.typ = exp.typ
		call.go#L533: 		if def != nil && x.typ == def {
		call.go#L545: 	obj, index, indirect = LookupFieldOrMethod(x.typ, x.mode == variable, check.pkg, sel)
		call.go#L548: 		if under(x.typ) == Typ[Invalid] {
		call.go#L559: 			check.errorf(e.Sel, _InvalidMethodExpr, "cannot call pointer method %s on %s", sel, x.typ)
		call.go#L564: 		if isInterfacePtr(x.typ) {
		call.go#L565: 			why = check.interfacePtrError(x.typ)
		call.go#L567: 			why = check.sprintf("type %s has no field or method %s", x.typ, sel)
		call.go#L579: 				if obj, _, _ = LookupFieldOrMethod(x.typ, x.mode == variable, check.pkg, changeCase); obj != nil {
		call.go#L598: 			check.errorf(e.Sel, _MissingFieldOrMethod, "%s.%s undefined (type %s has no method %s)", x.expr, sel, x.typ, sel)
		call.go#L602: 		check.recordSelection(e, MethodExpr, x.typ, m, index, indirect)
		call.go#L630: 		params = append([]*Var{NewVar(sig.recv.pos, sig.recv.pkg, name, x.typ)}, params...)
		call.go#L632: 		x.typ = &Signature{
		call.go#L645: 			check.recordSelection(e, FieldVal, x.typ, obj, index, indirect)
		call.go#L651: 			x.typ = obj.typ
		call.go#L656: 			check.recordSelection(e, MethodVal, x.typ, obj, index, indirect)
		call.go#L671: 				typ := x.typ
		call.go#L708: 			x.typ = &sig
		check.go#L414: 		typ = x.typ
		check.go#L417: 		typ = x.typ
		conversions.go#L25: 		case isInteger(x.typ) && isString(t):
		conversions.go#L56: 			if isString(x.typ) && isBytesOrRunes(u) {
		conversions.go#L95: 	if isUntyped(x.typ) {
		conversions.go#L105: 			final = Default(x.typ) // default type of untyped nil is untyped nil
		conversions.go#L106: 		} else if x.mode == constant_ && isInteger(x.typ) && allString(T) {
		conversions.go#L107: 			final = x.typ
		conversions.go#L112: 	x.typ = T
		conversions.go#L137: 	V := x.typ
		conversions.go#L228: 			x.typ = V.typ
		conversions.go#L246: 			x.typ = V.typ
		conversions.go#L259: 				errorf("cannot convert %s to %s (in %s)", x.typ, T.typ, Tp)
		expr.go#L76: 		if !pred(x.typ) {
		expr.go#L105: 	if isTyped(x.typ) {
		expr.go#L106: 		check.representable(x, under(x.typ).(*Basic))
		expr.go#L172: 		x.typ = &Pointer{base: x.typ}
		expr.go#L176: 		u := coreType(x.typ)
		expr.go#L195: 		x.typ = ch.elem
		expr.go#L211: 		if isUnsigned(x.typ) {
		expr.go#L212: 			prec = uint(check.conf.sizeof(x.typ) * 8)
		expr.go#L436: 		if isNumeric(x.typ) && isNumeric(typ) {
		expr.go#L444: 			if !isInteger(x.typ) && isInteger(typ) {
		expr.go#L620: 	if newType != x.typ {
		expr.go#L621: 		x.typ = newType
		expr.go#L633: 	if x.mode == invalid || isTyped(x.typ) || target == Typ[Invalid] {
		expr.go#L634: 		return x.typ, nil, 0
		expr.go#L639: 		xkind := x.typ.(*Basic).kind
		expr.go#L641: 		if isNumeric(x.typ) && isNumeric(target) {
		expr.go#L648: 		return x.typ, nil, 0
		expr.go#L664: 		switch x.typ.(*Basic).kind {
		expr.go#L718: 		return Default(x.typ), nil, 0
		expr.go#L743: 	ok, _ := x.assignableTo(check, y.typ, nil)
		expr.go#L745: 		ok, _ = y.assignableTo(check, x.typ, nil)
		expr.go#L757: 		cause = check.sprintf("mismatched types %s and %s", x.typ, y.typ)
		expr.go#L769: 			typ := x.typ
		expr.go#L771: 				typ = y.typ
		expr.go#L782: 		case !Comparable(x.typ):
		expr.go#L784: 			cause = check.incomparableCause(x.typ)
		expr.go#L787: 		case !Comparable(y.typ):
		expr.go#L789: 			cause = check.incomparableCause(y.typ)
		expr.go#L796: 		case !allOrdered(x.typ):
		expr.go#L799: 		case !allOrdered(y.typ):
		expr.go#L819: 		check.updateExprType(x.expr, Default(x.typ), true)
		expr.go#L820: 		check.updateExprType(y.expr, Default(y.typ), true)
		expr.go#L825: 	x.typ = Typ[UntypedBool]
		expr.go#L831: 		if isTypeParam(x.typ) || isTypeParam(y.typ) {
		expr.go#L833: 			if !isTypeParam(x.typ) {
		expr.go#L836: 			cause = check.sprintf("type parameter %s is not comparable with %s", errOp.typ, op)
		expr.go#L838: 			cause = check.sprintf("operator %s not defined on %s", op, check.kindString(errOp.typ)) // catch-all
		expr.go#L904: 	if allInteger(x.typ) || isUntyped(x.typ) && xval != nil && xval.Kind() == constant.Int {
		expr.go#L928: 		if isUntyped(y.typ) {
		expr.go#L940: 		case allInteger(y.typ):
		expr.go#L941: 			if !allUnsigned(y.typ) && !check.allowVersion(check.pkg, 1, 13) {
		expr.go#L946: 		case isUntyped(y.typ):
		expr.go#L967: 				if !isInteger(x.typ) {
		expr.go#L968: 					x.typ = Typ[UntypedInt]
		expr.go#L984: 			if !isInteger(x.typ) {
		expr.go#L985: 				x.typ = Typ[UntypedInt]
		expr.go#L999: 		if isUntyped(x.typ) {
		expr.go#L1030: 	if !allInteger(x.typ) {
		expr.go#L1084: 		if IsInterface(x.typ) && !isTypeParam(x.typ) || IsInterface(y.typ) && !isTypeParam(y.typ) {
		expr.go#L1087: 		if allBoolean(x.typ) != allBoolean(y.typ) {
		expr.go#L1090: 		if allString(x.typ) != allString(y.typ) {
		expr.go#L1093: 		if x.isNil() && !hasNil(y.typ) {
		expr.go#L1096: 		if y.isNil() && !hasNil(x.typ) {
		expr.go#L1102: 		check.convertUntyped(x, y.typ)
		expr.go#L1106: 		check.convertUntyped(&y, x.typ)
		expr.go#L1118: 	if !Identical(x.typ, y.typ) {
		expr.go#L1121: 		if x.typ != Typ[Invalid] && y.typ != Typ[Invalid] {
		expr.go#L1127: 				check.invalidOp(posn, _MismatchedTypes, "%s (mismatched types %s and %s)", e, x.typ, y.typ)
		expr.go#L1129: 				check.invalidOp(posn, _MismatchedTypes, "%s %s= %s (mismatched types %s and %s)", lhs, op, rhs, x.typ, y.typ)
		expr.go#L1143: 		if (x.mode == constant_ || allInteger(x.typ)) && y.mode == constant_ && constant.Sign(y.val) == 0 {
		expr.go#L1150: 		if x.mode == constant_ && y.mode == constant_ && isComplex(x.typ) {
		expr.go#L1169: 		if op == token.QUO && isInteger(x.typ) {
		expr.go#L1226: 	switch t := x.typ.(type) {
		expr.go#L1239: 		x.typ = Typ[Invalid]
		expr.go#L1250: 	x.typ = Typ[Invalid]
		expr.go#L1311: 			x.typ = sig
		expr.go#L1489: 							if Identical(vtyp, x.typ) {
		expr.go#L1494: 						visited[xkey] = append(visited[xkey], x.typ)
		expr.go#L1528: 		x.typ = typ
		expr.go#L1559: 		if isTypeParam(x.typ) {
		expr.go#L1563: 		if _, ok := under(x.typ).(*Interface); !ok {
		expr.go#L1580: 		x.typ = T
		expr.go#L1591: 			check.validVarType(e.X, x.typ)
		expr.go#L1592: 			x.typ = &Pointer{base: x.typ}
		expr.go#L1595: 			if !underIs(x.typ, func(u Type) bool {
		expr.go#L1611: 			x.typ = base
		expr.go#L1638: 		x.typ = check.typ(e)
		expr.go#L1685: 	method, alt := check.assertableTo(under(x.typ).(*Interface), T)
		expr.go#L1690: 	cause := check.missingMethodReason(T, x.typ, method, alt)
		expr.go#L1697: 	check.errorf(e, _ImpossibleAssert, "impossible type assertion: %s\n\t%s does not implement %s %s", e, T, x.typ, cause)
		expr.go#L1770: 		if t, ok := x.typ.(*Tuple); ok {
		index.go#L31: 		x.typ = check.varType(e.Orig)
		index.go#L32: 		if x.typ != Typ[Invalid] {
		index.go#L38: 		if sig, _ := under(x.typ).(*Signature); sig != nil && sig.TypeParams().Len() > 0 {
		index.go#L53: 	switch typ := under(x.typ).(type) {
		index.go#L64: 			x.typ = universeByte // use 'byte' name
		index.go#L73: 		x.typ = typ.elem
		index.go#L80: 			x.typ = typ.elem
		index.go#L86: 		x.typ = typ.elem
		index.go#L99: 		x.typ = typ.elem
		index.go#L104: 		if !isTypeParam(x.typ) {
		index.go#L173: 				x.typ = elem
		index.go#L181: 			x.typ = elem
		index.go#L201: 	if x.typ == nil {
		index.go#L202: 		x.typ = Typ[Invalid]
		index.go#L218: 	switch u := coreString(x.typ).(type) {
		index.go#L220: 		check.invalidOp(x, _NonSliceableOperand, "cannot slice %s: %s has no core type", x, x.typ)
		index.go#L241: 			if isUntyped(x.typ) {
		index.go#L242: 				x.typ = Typ[String]
		index.go#L254: 		x.typ = &Slice{elem: u.elem}
		index.go#L260: 			x.typ = &Slice{elem: u.elem}
		index.go#L358: 		return x.typ, -1
		index.go#L373: 	return x.typ, v
		index.go#L388: 	if !allInteger(x.typ) {
		infer.go#L140: 			if hasName(arg.typ) {
		infer.go#L254: 			if targ := arg.typ; isTyped(targ) {
		infer.go#L299: 			targ := Default(arg.typ)
		operand.go#L56: 	typ  Type
		operand.go#L108: 	if x.mode == value && x.typ == Typ[UntypedNil] {
		operand.go#L122: 			expr = TypeString(x.typ, qf)
		operand.go#L141: 		if x.typ != nil {
		operand.go#L142: 			if isUntyped(x.typ) {
		operand.go#L143: 				buf.WriteString(x.typ.(*Basic).name)
		operand.go#L164: 		if x.typ != Typ[Invalid] {
		operand.go#L166: 			if isGeneric(x.typ) {
		operand.go#L172: 			WriteType(&buf, x.typ, qf)
		operand.go#L173: 			if tpar, _ := x.typ.(*TypeParam); tpar != nil {
		operand.go#L215: 		x.typ = Typ[Invalid]
		operand.go#L219: 	x.typ = Typ[kind]
		operand.go#L225: 	return x.mode == value && x.typ == Typ[UntypedNil]
		operand.go#L239: 	V := x.typ
		operand.go#L338: 				errorf("cannot assign %s to %s (in %s)", x.typ, T.typ, Tp)
		operand.go#L357: 			x.typ = V.typ
		stmt.go#L245: 		check.convertUntyped(&v, x.typ)
		stmt.go#L263: 				if Identical(v.typ, vt.typ) {
		stmt.go#L269: 			seen[val] = append(seen[val], valueType{v.Pos(), v.typ})
		stmt.go#L421: 		u := coreType(ch.typ)
		stmt.go#L454: 		if !allNumeric(x.typ) {
		stmt.go#L455: 			check.invalidOp(s.X, _NonNumericIncDec, "%s%s (non-numeric type %s)", s.X, s.Tok, x.typ)
		stmt.go#L568: 		if x.mode != invalid && !allBoolean(x.typ) {
		stmt.go#L595: 			if x.mode != invalid && !Comparable(x.typ) && !hasNil(x.typ) {
		stmt.go#L596: 				check.errorf(&x, _InvalidExprSwitch, "cannot switch on %s (%s is not comparable)", &x, x.typ)
		stmt.go#L603: 			x.typ = Typ[Bool]
		stmt.go#L689: 		if isTypeParam(x.typ) {
		stmt.go#L692: 			if _, ok := under(x.typ).(*Interface); ok {
		stmt.go#L720: 					T = x.typ
		stmt.go#L806: 			if x.mode != invalid && !allBoolean(x.typ) {
		stmt.go#L834: 			u := coreType(x.typ)
		stmt.go#L837: 				cause = check.sprintf("%s has no core type", x.typ)
		stmt.go#L898: 					x.typ = typ
		stmt.go#L924: 					x.typ = typ
		typexpr.go#L37: 				x.typ = tpar
		typexpr.go#L133: 	x.typ = typ
		typexpr.go#L248: 			typ := x.typ
		typexpr.go#L265: 			typ := x.typ
		typexpr.go#L523: 	if isUntyped(x.typ) || isInteger(x.typ) {